﻿using System;

class Program
{
    static void Main()
    {
        Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}", "Type", "Size (bytes)", "Min Value", "Max Value");
        Console.WriteLine(new string('-', 80));

        PrintTypeInfo<sbyte>("sbyte");
        PrintTypeInfo<byte>("byte");
        PrintTypeInfo<short>("short");
        PrintTypeInfo<ushort>("ushort");
        PrintTypeInfo<int>("int");
        PrintTypeInfo<uint>("uint");
        PrintTypeInfo<long>("long");
        PrintTypeInfo<ulong>("ulong");
        PrintTypeInfo<float>("float");
        PrintTypeInfo<double>("double");
        PrintTypeInfo<decimal>("decimal");
    }

    static void PrintTypeInfo<T>(string typeName) where T : struct
    {
        Type type = typeof(T);
        Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}",
                          typeName,
                          System.Runtime.InteropServices.Marshal.SizeOf(type),
                          type.GetField("MinValue").GetValue(null),
                          type.GetField("MaxValue").GetValue(null));
    }
}